<?php

namespace Home\Model;
use Think\Model; 

class ApplyModel extends Model{
     protected $_validate = array(
		array('danwei', '/^\w{1,60}$/', '参赛单位必须1-60个字符', 1,'length',3),
		array('lingdui', '/^\w{1,60}$/', '领队必须1-60个字符', 1,'length',3),
		array('duiming', '/^\w{1,60}$/', '队名必须1-60个字符', 1,'length',3),
		array('zhidaolaoshi', '/^\w{1,60}$/', '指导老师必须1-60个字符', 1,'length',3),
		array('duiyuan', '/^\w{1,60}$/', '队员必须1-60个字符', 1,'length',3),
		array('lianxiren', '/^\w{1,60}$/', '联系人必须1-60个字符', 1,'length',3),
		array('shouji', '/^\w{1,60}$/', '手机号必须1-20个字符', 1,'length',3),
		array('email', 'require', "email不能为空" , 1, 'regex', 3),
		array('address', '/^\w{1,60}$/', '通信地址必须1-70个字符', 1,'length',3),
		array('youbian', '/^\w{1,60}$/', '邮政编码必须1-60个字符', 1,'length',3),

    );

    
    protected $_auto = array(
	
        array('uid', 'uid', 1, 'callback'),
		
    );
	
	protected function uid(){
		return $_SESSION['id'];
	}
	
}   









